/*  
 *  Copyright RobOtter (2008) 
 * 
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/** \file hcontrol_system.h
  *
  * Implement the low level robot control system
  */

#ifndef HCONTROL_SYSTEM_H
#define HCONTROL_SYSTEM_H

#include "hrobot_system.h"
#include "hposition_manager.h"
#include "vectors.h"

typedef struct hcontrol_system
{
  hrobot_system *hrs;
  hposition_manager *hpm;

  //___________________

  vxya_t consign;

}hcontrol_system;

/** \brief Zero structure */
void hcs_init(hcontrol_system *hcs);

/** \brief Set hposition manager to use */
void hcs_set_related_hposition_manager(hcontrol_system *hcs,
                                  hposition_manager *hpm);

/** \brief Set hrobot system to use */
void hcs_set_related_hrobot_system(hcontrol_system *hcs,
                                 hrobot_system *hrs);

//_____________________________
 
/** \brief Update control system and send consigns to motors */
void hcs_update(void *data);

//_____________________________

/** \brief Set new consign */
void hcs_set_consign(hcontrol_system *hcs, double x, double y, double a);

#endif/*HCONTROL_SYSTEM_H*/
